// var shell = require("shelljs"); //执行shell
var watch = require('watch'); // 监测目录变化
var path = require('path');
var purgePlugin = require('./plugin');

watch.watchTree(
  './src/views',
  {
    ignoreDirectoryPattern: /css/,
    interval: 1,
  },
  function (file) {
    if (typeof file == 'string' && file.includes('.vue')) {
      purgePlugin({
        html: file,
      });
    }
    // shell.exec("node ./src/index.js");
  }
);
watch.watchTree(
  './src/components',
  {
    ignoreDirectoryPattern: /css/,
    interval: 1,
  },
  function (file) {
    if (typeof file == 'string' && file.includes('.vue')) {
      purgePlugin({
        html: file,
      });
    }
    // shell.exec("node ./src/index.js");
  }
);
